﻿using Microsoft.OpenApi.Models;

namespace LDM.Framework;

public class SwaggerDocOptions
{
    public SwaggerDocOptions()
    {
        OpenApiSecurityScheme = new OpenApiSecurityScheme
        {
            In = ParameterLocation.Header,
            Type = SecuritySchemeType.ApiKey,
            Description = "直接在下框中输入Bearer {token}（注意两者之间是一个空格）",
            Name = "Authorization",
            BearerFormat = "JWT",
            Scheme = "Bearer"
        };
        OpenApiSecurityRequirement = new OpenApiSecurityRequirement
        {
             {
                new OpenApiSecurityScheme
                {
                    Reference = new OpenApiReference
                    {
                        Type = ReferenceType.SecurityScheme,
                        Id = "Bearer"
                    }
                },
                new string[] { }
            }
        };

        IncludeXmlComments = new List<string>(); 
    }
    public OpenApiSecurityScheme OpenApiSecurityScheme { get; set; }

    public OpenApiSecurityRequirement OpenApiSecurityRequirement { get; set; }

    public List<string> IncludeXmlComments { get; set; }
}
